package com.example.AIstudy.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.AIstudy.domain.CompositionDetail;
import com.example.AIstudy.domain.RecordDetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectKey;

@Mapper
public interface CompositionDao extends BaseMapper<CompositionDetail> {

    //插入一条作文评分详情
    @Insert("INSERT INTO compositiondetail(contentScore,contentComment,syntaxScore,syntaxComment,structureScore,structureComment,detailedSuggestions) " +
            "VALUES (#{contentScore},#{contentComment},#{syntaxScore},#{syntaxComment},#{structureScore},#{structureComment},#{detailedSuggestions})")
    @SelectKey(statement = "select last_insert_id()", keyProperty = "id",
            keyColumn = "id", resultType = Integer.class, before = false)
    void insertCompositionDetail(CompositionDetail compositionDetail);
}
